package com.xf.lastmall.repository;


import com.xf.lastmall.moudle.dto.NewOrderRefundDto;
import com.xf.lastmall.moudle.entity.OrderRefundEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;


@Repository
public interface OrderRefundRepository extends JpaRepository<OrderRefundEntity, String> {

    void deleteByRefundNo(String refundNo);

    /**
     * SELECT r.ID_,r.mall_code_,r.refund_type_,r.refund_no_,r.order_sub_no_,r.refund_amount_,
     * r.status_,r.member_id_,r.member_name_,r.source_,r.channel_,r.finish_time_,
     * r.create_time_,r.update_time_,r.refund_reason_,r.refund_numb_,
     * r.audit_time_,r.cashier_time_,r.handle_time_, m.channel_,m.pay_type_,d.use_end_time_,
     * r.re_trade_no_,m.order_type_,m.pay_discount_amount_
     * FROM tb_order_refund r
     * LEFT JOIN tb_order_detail d
     * ON r.order_sub_no_=d.order_sub_no_
     * LEFT JOIN tb_order_main m
     * ON d.order_no_=m.order_no_
     * WHERE r.order_no_=#{orderNo} AND r.delete_=0
     *
     * @param orderNo
     * @return
     */
    NewOrderRefundDto findRefundDtoByOrderNo(String orderNo);


}
